package com.hyving.home.redisdemo.cron;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

@Component
public class RedisTestRunner implements ApplicationRunner {

    @Autowired
    private RedisTemplate redisTemplate;
    @Override
    public void run(ApplicationArguments args) throws Exception {

        redisTemplate.opsForValue().set("hello","hello123");
        System.out.println(redisTemplate.opsForValue().get("hello"));


    }
}
